/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2024 All Rights Reserved.
 */
package com.alipay.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author jishupei.jsp
 * @version : SwaggerConfig, v0.1 2024年05月14日 5:18 下午 jishupei.jsp Exp $
 */
@Configuration
public class SwaggerConfig {
    @Bean
    public Docket defaultApi2() {
        // 创建 Docket 对象
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                        .title("小程序商品demo")
                        .description("小程序商品demo接口文档")
                        .version("0.0.1")
                        .build())
                // 设置分组名称
                .groupName("小程序商品demo")
                .select()
                // 指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.alipay.demo.controller"))
                .paths(PathSelectors.any())
                .build();
    }
}
